package com.unohacha.qqj.fzdr.my;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.unohacha.qqj.fzdr.R;
import com.unohacha.qqj.fzdr.fragment.PublicImageFragment;
import com.unohacha.qqj.mylibrary.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MyImageStoreActivity extends BaseActivity {

    @BindView(R.id.back)
    ImageView back;
    @BindView(R.id.my_image_tab)
    TabLayout myImageTab;
    @BindView(R.id.my_find_camera)
    TextView myFindCamera;
    @BindView(R.id.my_image_viewpager)
    ViewPager myImageViewpager;
    private String[] tabArray;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_my_image_store;
    }

    @Override
    protected void initView() {
        super.initView();
        inittabName();
        myImageViewpager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
            @Override
            public CharSequence getPageTitle(int position) {
                return tabArray[position];
            }

            @Override
            public Fragment getItem(int position) {
                return new PublicImageFragment();
            }

            @Override
            public int getCount() {
                return tabArray.length;
            }
        });
        myImageTab.setupWithViewPager(myImageViewpager);
    }

    private void inittabName() {
        tabArray = getResources().getStringArray(R.array.my_image_store_list);
        
    }


    @OnClick({R.id.back, R.id.my_image_tab, R.id.my_find_camera})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.my_image_tab:
                break;
            case R.id.my_find_camera:
                break;
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
